<?php

namespace App\Http\Requests\Game\Setting\Config\Fishing;

use App\Http\Requests\Request;

class UpdateRequest extends Request
{

    /**
     * 应用于请求的验证规则。
     *
     * @return array
     */
    public function rules()
    {
        return [
            'globals.global_revise' => 'required|numeric|between:0,2',

            'globals.room_fish_max' => 'required|numeric',
            'globals.room_bullet_max' => 'required|numeric',

            'globals.heartbeat.revise_ratio' => 'required|numeric',
            'globals.heartbeat.value_add_ratio' => 'required|numeric',

            'globals.rtp_period.init.cost' => 'required|numeric',
            'globals.rtp_period.init.gain' => 'required|numeric',
            'globals.rtp_period.add_rate' => 'required|numeric',
            'globals.rtp_period.add_time' => 'required|numeric',
            'globals.rtp_period.sub_rate' => 'required|numeric',
            'globals.rtp_period.sub_time' => 'required|numeric',
            'globals.rtp_period.reset_time' => 'required|numeric',
            'globals.rtp_period.rtp_expect' => 'required|numeric',
            'globals.rtp_period.period_time.*' => 'required|numeric',
            'globals.rtp_period.last_duration' => 'required|numeric',

            'globals.person_revise.init.cost' => 'required|numeric',
            'globals.person_revise.init.gain' => 'required|numeric',
            'globals.person_revise.revise.*.range.*' => 'nullable|numeric',
            'globals.person_revise.revise.*.value' => 'required|numeric',
            'globals.person_revise.last_count' => 'required|numeric',

            'globals.fish_revise.*.id' => 'required|numeric',
            'globals.fish_revise.*.name' => 'required|string|max:100',
            'globals.fish_revise.*.mapct' => 'required|numeric',
            'globals.fish_revise.*.add_mapct' => 'required|numeric',
            'globals.fish_revise.*.sub_mapct' => 'required|numeric',
        ];
    }

    /**
     * 自定义验证规则的错误消息。
     *
     * @return array
     */
    public function messages()
    {
        return [];
    }

    /**
     * 自定义字段名称。
     *
     * @return array
     */
    public function attributes()
    {
        return [];
    }
}
